package school

import "fmt"

type Teacher struct {
	Schooler
	isMonitor bool
	subject   uint
}
type TeacherInterface interface {
	CommonInterface
	GetSubject()
	IsMonitor()
}

func (T Teacher) IsMonitor() bool {
	return T.isMonitor
}
func (T Teacher) GetSubject() uint {
	return T.subject
}

//设置属性的值
func (T *Teacher) SetMonitor(v bool) {
	T.isMonitor = v
}
func (T *Teacher) SetSubject(v uint) {
	T.subject = v
}

func (T Teacher) AttendClass(subjectId uint) {
	var subject string
	if _, ok := subjects[T.subject]; ok {
		subject = subjects[T.subject]
	} else {
		subject = subjects[subjectId]
	}
	fmt.Println(T.name + " is teaching " + subject + " Class")
}
